package com.github.data_manage.domain.vo

import com.github.data_manage.enum.NumberRelation
import java.math.BigDecimal

open class FundDepthResearchQueryVo {

    open var screenOverallRateCondition: ScreenOverallRateQueryVo? = null

    open var aumRateCondition: AumRateQueryVo? = null

    open var meetingRateCondition: MeetingRateQueryVo? = null

    open var investmentRateCondition: InvestmentRateQueryVo? = null

    open var keyManRateCondition: KeyManRateQueryVo? = null

    open var invested: Boolean? = null

    fun screenOverallRateConditionFilter(): String {
        return if (screenOverallRateCondition == null) {
            ""
        } else {
            "and t2.screen_overall_rate ${screenOverallRateCondition!!.relation.text} ${screenOverallRateCondition!!.value}"
        }
    }

    fun aumRateConditionFilter(): String {
        return if (aumRateCondition == null) {
            ""
        } else {
            "and t2.aum_rate ${aumRateCondition!!.relation.text} ${aumRateCondition!!.value}"
        }
    }

    fun meetingRateConditionFilter(): String {
        return if (meetingRateCondition == null) {
            ""
        } else {
            "and t2.meeting_rate ${meetingRateCondition!!.relation.text} ${meetingRateCondition!!.value}"
        }
    }

    fun investmentRateConditionFilter(): String {
        return if (investmentRateCondition == null) {
            ""
        } else {
            "and t2.investment_rate ${investmentRateCondition!!.relation.text} ${investmentRateCondition!!.value}"
        }
    }

    fun keyManRateConditionFilter(): String {
        return if (keyManRateCondition == null) {
            ""
        } else {
            "and t2.key_man_rate ${keyManRateCondition!!.relation.text} ${keyManRateCondition!!.value}"
        }
    }
}

open class ScreenOverallRateQueryVo {

    open lateinit var relation: NumberRelation

    open lateinit var value: BigDecimal

    override fun toString(): String {
        return "Screen Overall Rate ${relation.text} $value"
    }
}

open class AumRateQueryVo {

    open lateinit var relation: NumberRelation

    open lateinit var value: BigDecimal

    override fun toString(): String {
        return "Aum Rate ${relation.text} $value"
    }
}

open class MeetingRateQueryVo {

    open lateinit var relation: NumberRelation

    open lateinit var value: BigDecimal

    override fun toString(): String {
        return "Meeting Rate ${relation.text} $value"
    }
}


open class InvestmentRateQueryVo {

    open lateinit var relation: NumberRelation

    open lateinit var value: BigDecimal

    override fun toString(): String {
        return "Investment Rate ${relation.text} $value"
    }
}


open class KeyManRateQueryVo {

    open lateinit var relation: NumberRelation

    open lateinit var value: BigDecimal

    override fun toString(): String {
        return "KeyMan Rate ${relation.text} $value"
    }
}
